//
//  BaseModel.m
//  UI24_CollectionView不规则瀑布流
//
//  Created by dllo on 16/1/15.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "BaseModel.h"


@implementation BaseModel

- (instancetype)initWithModel:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)baseModelWithDic:(NSDictionary *)dic {
    return [[[self class] alloc] initWithModel:dic];
}

+ (NSMutableArray *)baseModelHandleWithArr:(NSArray *)array {
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        id model = [[self class] baseModelWithDic:dic];
        [mArr addObject:model];
    }
    return mArr;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (id)valueForUndefinedKey:(NSString *)key {
    return @"as";
}

@end
